package com.ruiyeclub.controller;

import com.ruiyeclub.entity.MenuVO;
import com.ruiyeclub.feign.MenuFeign;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

/**
 * @author Ray。
 * @create 2020-03-06 19:31
 */
@Controller
@RequestMapping("/client")
public class ClientHandler {

    @Autowired
    private MenuFeign menuFeign;

    @GetMapping("/findAll")
    @ResponseBody //表示这里返回的是数据
    public MenuVO findAll(@RequestParam("page") int page, @RequestParam("limit") int limit){
        int index=(page-1)*limit;
        MenuVO all = menuFeign.findAll(index, limit);
        return all;
    }

    @GetMapping("/redirect/{location}")
    public String redirect(@PathVariable("location")String location){
        return location;
    }
}